package com.linn.home.service.impl;

import com.linn.home.dao.MenuDao;
import com.linn.home.entity.Menu;
import com.linn.home.service.MenuService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2018/8/4.
 */
@Service("menuService")
public class MenuServiceImpl implements MenuService {

    @Resource
    private MenuDao menuDao;

    @Override
    public List<Menu> findMenuByUserId(int userId) {
        return menuDao.findMenuByUserId(userId);
    }

    @Override
    public List<Menu> findMenuList() {
        return menuDao.findMenuList();
    }

    @Override
    public Menu findMenuByid(Integer pId) {
        return menuDao.findMenuByid(pId);
    }

    @Override
    public int addMenu(Menu menu) {
        return menuDao.addMenu(menu);
    }

    @Override
    public int updateMenu(Menu menu) {
        return menuDao.updateMenu(menu);
    }

    @Override
    public int deleteMenu(Menu menu) {
        return menuDao.deleteMenu(menu);
    }

    @Override
    public int findCountByPid(Integer parentId) {
        return menuDao.findCountByPid(parentId);
    }
}
